#ifndef __USER_EXTERN__H
#define __USER_EXTERN__H

/* 系统模块 */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "string.h"

#include "esp_system.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "system_const.h"
#include "esp_spi_flash.h"

/* 扩展模块 */
#include "usart_api.h"
#include "oled_api.h"
#include "button_api.h"
#include "bee_api.h"
#include "wifi_api.h"
#include "sntp_api.h"
#include "flash_api.h"
#include "bee_api.h"

#include "ui_api.h"
#include "system_lib.h"
#include "windows.h"
#include "system_ctl.h"
#include "weather_api.h"
#include "bmp_api.h"

#include "digimon_libs.h"
#include "digimon.h"

#define status_set_falg(s, bit) (s |= (1 << bit))
#define status_del_flag(s, bit) (s &= ~(1 << bit))
#define status_cek_flag(s, bit) ((s & (1 << bit)) != 0)

typedef void    DIGI_VOID;
#define UI_CLEAN_ON             1
#define UI_CLEAN_OFF            0
#define UI_ENABLE               1
#define UI_DISABLE              0

#define SCREAM_W                (128)
#define SCREAM_H                (64)
#define STRING_PADDING          (3)             /* 字符串边据 */
#define STRING_POS_Y_UP         (0)             /* 字符串上半个屏幕 */
#define STRING_POS_Y_DOWN       (SCREAM_H/2)    /* 字符串下半个屏幕 */
#define SYS_STRING_SIZE         (32)            /* 菜单系统字体大小 */
#define POSITION_RIGHT(tmp,size)     (SCREAM_W-(strlen(tmp)*(size/2))-STRING_PADDING)  
#define POSITION_CENTER(tmp,size)  ( (SCREAM_W - strlen(tmp)*(size/2) )/2)
#define T(x)                    (const uint8_t *)x
#define STR_SIZE_8  8
#define STR_SIZE_12 12
#define STR_SIZE_16 16
#define STR_SIZE_32 32

/* common */
void display_the_scream(void);

extern os_timer_t time_base_1000ms;
extern os_timer_t time_alarmScan_20000ms;
#endif